<template>
    <div>
        <el-button type="text" @click="back">返回</el-button><br>
        <span>订单编号：</span><span>{{order.id}}</span><br><br>
        <span>下单时间:</span><span>{{orderTime}}</span><br><br>
        <span>订单状态:</span><span>{{order.status}}</span><br><br>
        <span>员工编号：</span><span>{{order.waiterId}}</span><br><br>
        <span>顾客：</span><span>{{customer.realname}}</span><br><br>
        <span>顾客手机号：</span><span>{{customer.telephone}}</span><br><br>
    </div>
</template>

<script>
export default {
    data(){
        return{
            order:[],
            orderTime:"",
            customer:[]
        }
    },
    created(){
        var id=this.$route.query.id.id;
        this.$axios.get("/order/findById",{params:{id}}).then(response=>{
            this.order=response.data.data;
            this.orderTime=new Date(response.data.data.orderTime).toLocaleString()
            console.log(this.order)
            this.customer=response.data.data.customer
        })
    },
    methods:{
        back(){
            this.$router.push({path:"/indentManagement/index"});
        }
    }
}
</script>